package com.etong.citymap.db.util;

import android.app.Application;
import android.location.Location;

import com.etong.citymap.bean.ImageBean;
import com.etong.citymap.module.SentenceBean;
import com.etong.citymap.module.SinglecallBean;
import com.etong.citymap.util.CityException;
import com.supermap.data.Point2D;

import java.util.ArrayList;

/**
 * @author skyline
 */
public class CityApplication extends Application {
	/** 是否真正退出 */
    public static boolean realLogout = false;
    //public static String HTTPURL="http://192.168.10.139/pdasystemnew/";
	private String HTTPURL = "http://192.168.1.61/jhhwpdasystemnew/";
	private String HTTPRefreshUrl = "http://192.168.1.61/jhhwpdasystemnew/CityMap.zip";
	//public static String HTTPRefreshUrl="http://192.168.10.139/pdasystemnew/CityMap.zip";
	public final String CameraPath = "/szhw/image";

	private int historySaveTime = 1;

	public final static String DATABASENAME = "szhw";
	public final static int DATABASEVERSION = 1;

	public final int WelocmeTimeoutTime = 1000;

	private String userName = "";
	private String userId = "";
	private String userCode = "";

	public final int PageCount = 10;

	private ImageBean[] imageList;    //上传
	private ImageBean[] imageList_Net; //网络图片
	private int imageListPosttion = 0;  //选择第几个  0上传 1网络图片

	private boolean isFristCamer = false;
	//private ScreenBean screenBean;
	private SentenceBean CacheSentence;//用作缓存

	private Point2D gpsPoint; //当前坐标信息
	private double creenDateTime;//当前系统资源

	private int TodayCueCountNo = 0;

	private ArrayList<SinglecallBean> CachecontactBeans = new ArrayList<SinglecallBean>();

	//执法通
	private String ZFTUserName;
	private String ZFTUserId;
	private String ZFTOrgId;

	//后台默认上传次数多于这个数以后该记录就不上传了
	public final int uploadSum = 10;

	private boolean isSave = false;

	private Point2D locPoint = null;//当前坐标点
	private String bgCode;//当前坐标点所有单元编码
	private String commName;//单元社区名称

	private boolean returnResult;//打开地图时，是否需要回传值
	private Point2D prePoint = null;


	/**
	 * 定时任务获得到位置信息
	 */
	private static Location location;

	@Override
	public void onCreate() {
		super.onCreate();
		CityException customException = CityException.getInstance();

		customException.init(getApplicationContext());
	}


	public boolean isSave() {
		return isSave;
	}

	public void setSave(boolean isSave) {
		this.isSave = isSave;
	}

	public String getZFTUserName() {
		return ZFTUserName;
	}

	public void setZFTUserName(String zFTUserName) {
		ZFTUserName = zFTUserName;
	}

	public String getZFTUserId() {
		return ZFTUserId;
	}

	public void setZFTUserId(String zFTUserId) {
		ZFTUserId = zFTUserId;
	}

	public String getZFTOrgId() {
		return ZFTOrgId;
	}

	public void setZFTOrgId(String zFTOrgId) {
		ZFTOrgId = zFTOrgId;
	}

	public ArrayList<SinglecallBean> getCachecontactBeans() {
		return CachecontactBeans;
	}

	public void setCachecontactBeans(ArrayList<SinglecallBean> cachecontactBeans) {
		CachecontactBeans = cachecontactBeans;
	}

	public int getTodayCueCountNo() {
		return TodayCueCountNo;
	}

	public void setTodayCueCountNo(int todayCueCountNo) {
		TodayCueCountNo = todayCueCountNo;
	}

	public double getCreenDateTime() {
		return creenDateTime;
	}

	public void setCreenDateTime(double creenDateTime) {
		this.creenDateTime = creenDateTime;
	}

	public SentenceBean getCacheSentence() {
		return CacheSentence;
	}

	public void setCacheSentence(SentenceBean cacheSentence) {
		CacheSentence = cacheSentence;
	}

	public boolean isFristCamer() {
		return isFristCamer;
	}

	public void setFristCamer(boolean isFristCamer) {
		this.isFristCamer = isFristCamer;
	}

	public int getImageListPosttion() {
		return imageListPosttion;
	}

	public void setImageListPosttion(int imageListPosttion) {
		this.imageListPosttion = imageListPosttion;
	}

	public ImageBean[] getImageList() {
		return imageList;
	}

	public void setImageList(ImageBean[] imageList) {
		this.imageList = imageList;
	}

	public ImageBean[] getImageList_Net() {
		return imageList_Net;
	}

	public void setImageList_Net(ImageBean[] imageList_Net) {
		this.imageList_Net = imageList_Net;
	}

	public String getUserName() {
		return userName;
	}

	public void setUserName(String userName) {
		this.userName = userName;
	}

	public String getUserId() {
		return userId;
	}

	public void setUserId(String userId) {
		this.userId = userId;
	}

	public String getUserCode() {
		return userCode;
	}

	public void setUserCode(String userCode) {
		this.userCode = userCode;
	}

	public Point2D getLocPoint() {
		return locPoint;
	}

	public void setLocPoint(Point2D locPoint) {
		this.locPoint = locPoint;
	}

	public int getHistorySaveTime() {
		return historySaveTime;
	}

	public void setHistorySaveTime(int historySaveTime) {
		this.historySaveTime = historySaveTime;
	}

	public String getHTTPRefreshUrl() {
		return HTTPRefreshUrl;
	}

	public void setHTTPRefreshUrl(String hTTPRefreshUrl) {
		HTTPRefreshUrl = hTTPRefreshUrl;
	}

	public String getHTTPURL() {
		return HTTPURL;
	}

	public void setHTTPURL(String hTTPURL) {
		HTTPURL = hTTPURL;
	}


	public String getBgCode() {
		return bgCode;
	}


	public void setBgCode(String bgCode) {
		this.bgCode = bgCode;
	}


	public String getCommName() {
		return commName;
	}


	public void setCommName(String commName) {
		this.commName = commName;
	}

	public boolean isReturnResult() {
		return returnResult;
	}


	public void setReturnResult(boolean returnResult) {
		this.returnResult = returnResult;
	}


	public Point2D getPrePoint() {
		return prePoint;
	}


	public void setPrePoint(Point2D prePoint) {
		this.prePoint = prePoint;
	}


	public Point2D getGpsPoint() {
		return gpsPoint;
	}


	public void setGpsPoint(Point2D gpsPoint) {
		this.gpsPoint = gpsPoint;
	}

	public synchronized static Location getLocation() {
		return location;
	}

	public synchronized static void setLocation(Location location) {
		CityApplication.location = location;
	}
}
